<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>cs</title>
  </head>
  <body>
    <div>
      1
    </div>
    <img src="http://img1.qunarzz.com/piao/fusion/1801/1a/94428c6dea109402.jpg_640x200_2cf590d8.jpg" onclick="ButtonClick(this)"> 
    <script src="https://csdnimg.cn/public/common/libs/jquery/jquery-1.9.1.min.js"></script>
    <script>
var oPopup = window.createPopup();  
function ButtonClick(div)  
{  
//var div = document.getElementById('divId');  
div.contentEditable = 'true';  
var controlRange;  
if (document.body.createControlRange) {  
controlRange = document.body.createControlRange();  
controlRange.addElement(div);  
controlRange.execCommand('Copy');  
}  
div.contentEditable = 'false';  
}  
    </script>
  </body>
</html>
